package hong.jun.service.impl;


import dev.morphia.dao.BasicDAO;
import hong.jun.dao.RoleDao;
import hong.jun.data.role.Role;

/**
 * @Description:
 * @Author: yanghongjun
 * @Date: 2023/11/20
 **/
public class RoleServiceImpl extends MongoBaseServiceImpl<Role,Long> {

    /**
     * 用枚举来实现单例
     */
    private enum Singleton {
        INSTANCE;
        final RoleServiceImpl processor;

        Singleton() {
            this.processor = new RoleServiceImpl();
        }

        RoleServiceImpl getProcessor() {
            return processor;
        }
    }

    /**
     * 获取实例对象
     */
    public static RoleServiceImpl getInstance() {
        return Singleton.INSTANCE.getProcessor();
    }

    @Override
    public BasicDAO<Role, Long> getDao() {
        return RoleDao.getInstance();
    }

    @Override
    public Long getKeyName() {
        return null;
    }

}
